#include "../tools.h"

class CQueue {
public:
    CQueue() {

    }
    
    void appendTail(int value) {
        st1.push(value);
    }
    
    int deleteHead() {
        if (!st2.empty()){
            int res = st2.top();
            st2.pop();
            return res;
        }
        else{
            if (st1.empty()) return -1;
            else{
                while(!st1.empty()){
                    st2.push(st1.top());
                    st1.pop();
                }
                int res = st2.top();
                st2.pop();
                return res;
            }
        }
    }

private:
    stack<int> st1, st2;
};


int main(int argc, char const *argv[])
{
    

    CQueue* obj = new CQueue();
    obj->appendTail(3);
    int param_2 = obj->deleteHead();
    cout << param_2 << endl;


    return 0;
}


